import 'package:dio/dio.dart';

class HttpsClient {
  static String domain = 'https://miapp.itying.com';
  static Dio dio = Dio();

  HttpsClient() {
    dio.options.baseUrl = domain;
    dio.options.connectTimeout = Duration(seconds: 5);
    dio.options.receiveTimeout = Duration(seconds: 5);
  }

  Future get(apiUrl) async {
    try {
      var response = dio.get(apiUrl);
      return response;
    } catch (e) {
      print('请求超时:$e');
      return null;
    }
  }

  static photoUrl(picUrl) {
    return '$domain/' + picUrl;
  }
}
